
local mt = ac.skill['腐臭封群']
mt.targettype = '点'
mt.range = 600
mt.area = 400
mt.missile_art = [[Abilities\Spells\Undead\FrostNova\FrostNovaTarget.mdl]]

function mt:on_cast_shot()
    local hero = self.owner
    local target = self.target
    local point1 = hero:get_point()
    local point2 = target:get_point()
    local angle = point1/point2 + 60
    local damage = hero:get('攻击') * self.data1
    local time = 1
    ac.timer(time * 1000,2,function(t)
        if hero:is_alive() then
            point1:effect{
                model = [[fdcd174428a0c65293cd271ce959629e.mdx]],
                angle = angle,
                time = time,
                height = 90,
            }
            ac.wait(time*1000,function()
                hero:remove_restriction '硬直'
                if hero:is_alive() then
                    local mover = hero:launch_wave(self.missile_art,angle,900,1200)
                    sc.loopUnit(0.03,mover,275,function(_,unit)
                        if unit:is_enemy(hero) then
                            hero:create_damage(unit,damage,self)
                        end
                    end)
                end
                hero:issue_order('attack',ac.enemy.base)
            end)
        end
    end)
    
end
